Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 6: Rotating Shapes

../ch06/06fig11.gif
Figure 6.11

The lower arm of a desk lamp, rotated using a center of rotation at the lower end of the arm

06fig11.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group{
    children [
    # Lamp base
        Shape {
            appearance DEF White Appearance {
                material Material { }
            }
            geometry Cylinder {
                radius 0.1
                height 0.01
            }
        },
    # Base joint
        Transform {
            translation 0.0 0.15 0.0
            rotation    1.0 0.0 0.0  -0.7
            center      0.0 -0.15 0.0
            children [
                # Lower arm
                Shape {
                    appearance USE White
                    geometry Cylinder {
                        radius 0.01
                        height 0.3
                    }
                }
            ]
        }
    ]
}